<template>
	<view class="appraisalMessage">

		<view class="appraisalMessage-plate-1">
			<view class="item-box" v-for="(item,index) in messageList" :key="index">
				<view class="time">
					{{item.date_time}}
				</view>
				<view class="item" @click="goResult(i.authentication_id)" v-for="(i,num) in item.authentication" :key="num">
					<view class="img-left">
						<image :src="i.authen_pic[0]" mode=""></image>
						<!-- <image src="../../../static/ic_identify_imgs.png" mode="widthFix"></image> -->
					</view>
					<view class="item-right">
						<view class="zhuangtai" v-if="i.authen_type == 0">
							未鉴定
						</view>
						<view class="zhuangtai" v-if="i.authen_type == 1">
							鉴定师初审
						</view>
						<view class="zhuangtai" v-if="i.authen_type == 2">
							首席鉴定师复核
						</view>
						<view class="zhuangtai" v-if="i.authen_type == 3">
							出具鉴定结果
						</view>
						<view class="txt">
							<text>购买渠道：{{i.buy_channel_name}}</text>
							<text v-if="i.authen_channel == 1">鉴定渠道：图片鉴定</text>
							<text v-if="i.authen_channel == 2">鉴定渠道：在线鉴定</text>
						</view>
						<view class="txt">
							<text>物品描述：{{i.description}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="nullList" v-if="messageList.length == 0">
			<u-empty text="暂无鉴定消息" mode="history" color="#999" font-size="40"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				messageList:[],
				page:1
			}
		},
		created() {
			this.getMessageList()
		},
		methods: {
			//请求消息列表
			getMessageList(){
				uni.request({
				    url:this.$Url +'/index.php/app/Authentication/fetchAuthenReportList',
				    method:'POST',
				    data:{
				       p:this.page,
					   type:2
				    },
				    header:{
				        "token":uni.getStorageSync('token')
				    },
				    success: (res) => {
						if (res.data.status == 200) {
							this.messageList = this.messageList.concat(res.data.data.report)
						} else{
							uni.showToast({
								title:res.data.msg,
								icon:'none',
								duration:1200
							})
						}
				    }
				})
			},
			// 前往鉴定结果
			goResult(id){
				uni.navigateTo({
					url:'appraisalResult/appraisalResult?id=' + id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.appraisalMessage{
	width: 100vw;
	min-height: 100vh;
	background-color: #f7f7f7;
	.nullList {
		display: flex;
		align-items: center;
		flex-direction: column;
		justify-content: center;
		height: 740upx;
		
	}
	.time{
		font-size: 15upx;
		color: #a2a2a2;
		height: 72upx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.appraisalMessage-plate-1{
		.item{
			height: 207upx;
			border-bottom: 1px solid #e2e2e2;
			background-color: #fff;
			display: flex;
			align-items: center;
			.img-left{
				position: relative;
				width: 145upx;
				height: 145upx;
				margin-right: 20upx;
				margin-left: 20upx;
				image:first-child{
					width: 145upx;
					height: 145upx;
				}
				image:last-child{
					width: 51upx;
					position: absolute;
					right: 0;
					bottom: 0;
					z-index: 10;
				}
			}
			.item-right{
				display: flex;
				flex-direction: column;
				margin-top: 10upx;
				.zhuangtai{
					font-size: 32upx;
					color: $zhuti-color;
					margin-bottom: 25upx;
				}
				.txt{
					font-size: 22upx;
					color: $uni-text-color-grey;
					margin-right: 50upx;
					margin-bottom: 18upx;
				}
			}
		}
	}
}
</style>
